using System.ServiceModel;
using System.ServiceModel.Channels;
namespace jSLApp.Client.MainService {
public class MainServiceSyncedChannel
{
private MainServiceChannel _asyncChannel;
#region Constructors
        public MainServiceSyncedChannel(string endpointConfigurationName, EndpointAddress remoteAddress)
        {
            var factory = new ChannelFactory<MainServiceChannel>(endpointConfigurationName, remoteAddress);
            CreateChannel(factory);
        }

        public MainServiceSyncedChannel(Binding binding, EndpointAddress rem)
        {
            var factory = new ChannelFactory<MainServiceChannel>(binding, rem);
            CreateChannel(factory);
        }

        public MainServiceSyncedChannel(string endpointConfigurationName)
        {
            var factory = new ChannelFactory<MainServiceChannel>(endpointConfigurationName);
            CreateChannel(factory);
        }

        private void CreateChannel(ChannelFactory<MainServiceChannel> factory)
        {
            _asyncChannel = factory.CreateChannel();
        }

        #endregion


public void SpamThem()
{
var result = _asyncChannel.BeginSpamThem(null,null);
_asyncChannel.EndSpamThem(result);
}
public void UnSubsribeAll(System.Guid code)
{
var result = _asyncChannel.BeginUnSubsribeAll(code,null,null);
_asyncChannel.EndUnSubsribeAll(result);
}
public jSLApp.Client.MainService.Topic GetTopic(int topicId)
{
var result = _asyncChannel.BeginGetTopic(topicId,null,null);
return _asyncChannel.EndGetTopic(result);
}
public void DeleteTopic(int topicId)
{
var result = _asyncChannel.BeginDeleteTopic(topicId,null,null);
_asyncChannel.EndDeleteTopic(result);
}
public void SetDone(int musicId)
{
var result = _asyncChannel.BeginSetDone(musicId,null,null);
_asyncChannel.EndSetDone(result);
}
public jSLApp.Client.MainService.Comment[] GetComments(int entityId)
{
var result = _asyncChannel.BeginGetComments(entityId,null,null);
return _asyncChannel.EndGetComments(result);
}
public void DeleteComment(int commentId)
{
var result = _asyncChannel.BeginDeleteComment(commentId,null,null);
_asyncChannel.EndDeleteComment(result);
}
public void CreateComment(int entityId, string xamlText, jSLApp.Client.MainService.Rate rating)
{
var result = _asyncChannel.BeginCreateComment(entityId,xamlText,rating,null,null);
_asyncChannel.EndCreateComment(result);
}
public int CreateArticle(string brief, string header, byte[] image, jSLApp.Client.MainService.ArticleType type, byte[] file, string ext)
{
var result = _asyncChannel.BeginCreateArticle(brief,header,image,type,file,ext,null,null);
return _asyncChannel.EndCreateArticle(result);
}
public jSLApp.Client.MainService.New GetArticle(int id)
{
var result = _asyncChannel.BeginGetArticle(id,null,null);
return _asyncChannel.EndGetArticle(result);
}
public jSLApp.Client.MainService.New[] SearchArticles(string searchText)
{
var result = _asyncChannel.BeginSearchArticles(searchText,null,null);
return _asyncChannel.EndSearchArticles(result);
}
public void DeleteArticle(int articleId)
{
var result = _asyncChannel.BeginDeleteArticle(articleId,null,null);
_asyncChannel.EndDeleteArticle(result);
}
public void SendMailToUser(string login, string message)
{
var result = _asyncChannel.BeginSendMailToUser(login,message,null,null);
_asyncChannel.EndSendMailToUser(result);
}
public bool CanRate(int _musicId)
{
var result = _asyncChannel.BeginCanRate(_musicId,null,null);
return _asyncChannel.EndCanRate(result);
}
public void SetDontShowChat(bool show)
{
var result = _asyncChannel.BeginSetDontShowChat(show,null,null);
_asyncChannel.EndSetDontShowChat(result);
}
public bool GetDontShowChat()
{
var result = _asyncChannel.BeginGetDontShowChat(null,null);
return _asyncChannel.EndGetDontShowChat(result);
}
public void ChangeMailSettings(string login, bool newsMail, bool messageMail, bool commentMail)
{
var result = _asyncChannel.BeginChangeMailSettings(login,newsMail,messageMail,commentMail,null,null);
_asyncChannel.EndChangeMailSettings(result);
}
public void ManualAcceptMail(string login)
{
var result = _asyncChannel.BeginManualAcceptMail(login,null,null);
_asyncChannel.EndManualAcceptMail(result);
}
public jSLApp.Client.MainService.Message[] GetUserMessages(string login, string searchText, bool inOrOutBox)
{
var result = _asyncChannel.BeginGetUserMessages(login,searchText,inOrOutBox,null,null);
return _asyncChannel.EndGetUserMessages(result);
}
public jSLApp.Client.MainService.Message GetUserMessage(int messageId)
{
var result = _asyncChannel.BeginGetUserMessage(messageId,null,null);
return _asyncChannel.EndGetUserMessage(result);
}
public void SendMessage(string to, string text)
{
var result = _asyncChannel.BeginSendMessage(to,text,null,null);
_asyncChannel.EndSendMessage(result);
}
public jSLApp.Client.MainService.User[] GetUserListSimple(string searchText)
{
var result = _asyncChannel.BeginGetUserListSimple(searchText,null,null);
return _asyncChannel.EndGetUserListSimple(result);
}
public void EncreaseListenCount(int id)
{
var result = _asyncChannel.BeginEncreaseListenCount(id,null,null);
_asyncChannel.EndEncreaseListenCount(result);
}
public void EncreaseDownloadCount(int id)
{
var result = _asyncChannel.BeginEncreaseDownloadCount(id,null,null);
_asyncChannel.EndEncreaseDownloadCount(result);
}
public void ChangeAllowDownload(int id, bool allowDownload)
{
var result = _asyncChannel.BeginChangeAllowDownload(id,allowDownload,null,null);
_asyncChannel.EndChangeAllowDownload(result);
}
public jSLApp.Client.MainService.User[] SearchUser(string searchText, bool showUnaccepted)
{
var result = _asyncChannel.BeginSearchUser(searchText,showUnaccepted,null,null);
return _asyncChannel.EndSearchUser(result);
}
public jSLApp.Client.MainService.Music[] SearchMusicList(string searchText)
{
var result = _asyncChannel.BeginSearchMusicList(searchText,null,null);
return _asyncChannel.EndSearchMusicList(result);
}
public jSLApp.Client.MainService.Music[] GetUserMusicList(string author)
{
var result = _asyncChannel.BeginGetUserMusicList(author,null,null);
return _asyncChannel.EndGetUserMusicList(result);
}
public void SubmitEMail(System.Guid code)
{
var result = _asyncChannel.BeginSubmitEMail(code,null,null);
_asyncChannel.EndSubmitEMail(result);
}
public void SaveAllRoles(jSLApp.Client.MainService.Role[] roles)
{
var result = _asyncChannel.BeginSaveAllRoles(roles,null,null);
_asyncChannel.EndSaveAllRoles(result);
}
public jSLApp.Client.MainService.Role[] GetAllRoles()
{
var result = _asyncChannel.BeginGetAllRoles(null,null);
return _asyncChannel.EndGetAllRoles(result);
}
public jSLApp.Client.MainService.Role[] GetAdministratorRoleAccess()
{
var result = _asyncChannel.BeginGetAdministratorRoleAccess(null,null);
return _asyncChannel.EndGetAdministratorRoleAccess(result);
}
public void Registration(string login, string pwd, string mail)
{
var result = _asyncChannel.BeginRegistration(login,pwd,mail,null,null);
_asyncChannel.EndRegistration(result);
}
public string GetCurrentAuthorName()
{
var result = _asyncChannel.BeginGetCurrentAuthorName(null,null);
return _asyncChannel.EndGetCurrentAuthorName(result);
}
public byte[] GetUserImage(string userLogin)
{
var result = _asyncChannel.BeginGetUserImage(userLogin,null,null);
return _asyncChannel.EndGetUserImage(result);
}
public int CreateTopic(string theme, string message)
{
var result = _asyncChannel.BeginCreateTopic(theme,message,null,null);
return _asyncChannel.EndCreateTopic(result);
}
public void CreateChat(string message)
{
var result = _asyncChannel.BeginCreateChat(message,null,null);
_asyncChannel.EndCreateChat(result);
}
public jSLApp.Client.MainService.Chat[] GetChat(System.DateTime lastCall)
{
var result = _asyncChannel.BeginGetChat(lastCall,null,null);
return _asyncChannel.EndGetChat(result);
}
public jSLApp.Client.MainService.Subsription[] GetMySubscriptions()
{
var result = _asyncChannel.BeginGetMySubscriptions(null,null);
return _asyncChannel.EndGetMySubscriptions(result);
}
public void DeleteMySubscriptions()
{
var result = _asyncChannel.BeginDeleteMySubscriptions(null,null);
_asyncChannel.EndDeleteMySubscriptions(result);
}
public bool IsSubscripted(int commentableId)
{
var result = _asyncChannel.BeginIsSubscripted(commentableId,null,null);
return _asyncChannel.EndIsSubscripted(result);
}
public void CreateSubscription(int commentableId)
{
var result = _asyncChannel.BeginCreateSubscription(commentableId,null,null);
_asyncChannel.EndCreateSubscription(result);
}
public void DeleteSubscription(int subscriptionId)
{
var result = _asyncChannel.BeginDeleteSubscription(subscriptionId,null,null);
_asyncChannel.EndDeleteSubscription(result);
}
public jSLApp.Client.MainService.Commentable[] SearchForum(string sText)
{
var result = _asyncChannel.BeginSearchForum(sText,null,null);
return _asyncChannel.EndSearchForum(result);
}
public void DeleteMusic(int musicId)
{
var result = _asyncChannel.BeginDeleteMusic(musicId,null,null);
_asyncChannel.EndDeleteMusic(result);
}
public void ChangeMusicName(int musicId, string newName)
{
var result = _asyncChannel.BeginChangeMusicName(musicId,newName,null,null);
_asyncChannel.EndChangeMusicName(result);
}
public void ChangeCurrentUserName(string newName)
{
var result = _asyncChannel.BeginChangeCurrentUserName(newName,null,null);
_asyncChannel.EndChangeCurrentUserName(result);
}
public void ChangePictureForCurrentUser(byte[] bs)
{
var result = _asyncChannel.BeginChangePictureForCurrentUser(bs,null,null);
_asyncChannel.EndChangePictureForCurrentUser(result);
}
public void ChangeMusicInfo(int musicId, string newInfo)
{
var result = _asyncChannel.BeginChangeMusicInfo(musicId,newInfo,null,null);
_asyncChannel.EndChangeMusicInfo(result);
}
public void ChangeMusicPicture(int musicId, byte[] bs)
{
var result = _asyncChannel.BeginChangeMusicPicture(musicId,bs,null,null);
_asyncChannel.EndChangeMusicPicture(result);
}
public void Visit()
{
var result = _asyncChannel.BeginVisit(null,null);
_asyncChannel.EndVisit(result);
}
public int AddMusic(string songName, byte[] music, double durationIsSeconds)
{
var result = _asyncChannel.BeginAddMusic(songName,music,durationIsSeconds,null,null);
return _asyncChannel.EndAddMusic(result);
}
public jSLApp.Client.MainService.SystemLog[] GetLogs()
{
var result = _asyncChannel.BeginGetLogs(null,null);
return _asyncChannel.EndGetLogs(result);
}
public byte[] GetMusicFile(int musicId)
{
var result = _asyncChannel.BeginGetMusicFile(musicId,null,null);
return _asyncChannel.EndGetMusicFile(result);
}
public jSLApp.Client.MainService.Music GetMusic(int id)
{
var result = _asyncChannel.BeginGetMusic(id,null,null);
return _asyncChannel.EndGetMusic(result);
}
public void SaveIsPublic(int musicId, bool isPublic)
{
var result = _asyncChannel.BeginSaveIsPublic(musicId,isPublic,null,null);
_asyncChannel.EndSaveIsPublic(result);
}
public jSLApp.Client.MainService.User GetUser(string login)
{
var result = _asyncChannel.BeginGetUser(login,null,null);
return _asyncChannel.EndGetUser(result);
}
public jSLApp.Client.MainService.User GetProject(string login)
{
var result = _asyncChannel.BeginGetProject(login,null,null);
return _asyncChannel.EndGetProject(result);
}
public void SetIsEnabled(string login, bool isEnabled)
{
var result = _asyncChannel.BeginSetIsEnabled(login,isEnabled,null,null);
_asyncChannel.EndSetIsEnabled(result);
}
public void SubmitPasswordChange(System.Guid pwdCode, string newPwd)
{
var result = _asyncChannel.BeginSubmitPasswordChange(pwdCode,newPwd,null,null);
_asyncChannel.EndSubmitPasswordChange(result);
}
public void ResetPassword(string login, string mail)
{
var result = _asyncChannel.BeginResetPassword(login,mail,null,null);
_asyncChannel.EndResetPassword(result);
}
public void RoleChange(string login, System.Guid newRole)
{
var result = _asyncChannel.BeginRoleChange(login,newRole,null,null);
_asyncChannel.EndRoleChange(result);
}
public byte[] GetNoPhotoImage()
{
var result = _asyncChannel.BeginGetNoPhotoImage(null,null);
return _asyncChannel.EndGetNoPhotoImage(result);
}
public byte[] ConvertImageToPng150x150(byte[] bs)
{
var result = _asyncChannel.BeginConvertImageToPng150x150(bs,null,null);
return _asyncChannel.EndConvertImageToPng150x150(result);
}
public void DeleteUser(string login)
{
var result = _asyncChannel.BeginDeleteUser(login,null,null);
_asyncChannel.EndDeleteUser(result);
}

}
}
